//
//  BaseRequest.h
//  SDCarBusiness
//
//  Created by 李梦艳 on 14-12-8.
//  Copyright (c) 2014年 殷佳斌. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "AFNetworking.h"

@interface BaseRequest : NSObject

/**
 *     请求方法,进行与服务器的请求动作
 *
 *@param    action  请求服务器的响应链接的最后一个字段
 *@param    baseUrl 请求服务器的响应链接
 *@param    params  请求服务器的具体参数:将参数和参数名封装为一个可变字典的格式
 *@param    success 请求成功时的处理block
 *@param    failure	请求失败时的处理block
 */
- (void)sendPostRequestWithAction:(NSString *)action
                          baseUrl:(NSString *)baseUrl
                           params:(NSDictionary *)params
                          success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
                          failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure;
/**
 *  用户登录
 *
 *  @param keyWord    搜索关键字
 *  @param pages      请求的第几页
 *  @param success    请求成功处理的block
 *  @param failure    请求失败处理的block
 */
-(void)searchVideoWithKeyWord:(NSString *)keyWorld
                             pagesNumber:(NSInteger)pages
                             success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
                             failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure;
/**
 *  上传图片
 *
 *  @param image      要上传的图片
 *  @param success    请求成功处理的block
 *  @param failure    请求失败处理的block
 */
- (void)postImage:(UIImage*)image
                  success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
                  failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure;


@end
